<?php

namespace app\admin\controller;
use app\admin\model\AssessModel;
use app\common\controller\AdminBaseController;
use think\Db;
/**
 *评价表
 */
class AssessController extends AdminBaseController
{
 	 protected $model;
	
    protected function _initialize() {
        parent::_initialize();
        $this->model = new AssessModel();
    }
	
    /**
     * 评价列表
     * @author [lx] 
     */
    public function index( $page = 1){
    	$map = [];
		if(request()->isPost()){
		 	$param = input('post.');
		 	//订单编号
			if($param['order']){
				$map['order_no'] = ['like', '%'.$param['order'].'%'];
			}
             // 添加时间
			if($param['add_time']&&$param['end_time']){
             $map['a.add_time'] = ['between time', [$param['add_time'],$param['end_time']]];

			}
	    }	

		$where = '';
		$list = $this->model->where($where)->paginate(10);
        return $this->fetch('index', ['list' => $list]);
    }

      /**
     * [详情]
     * @author [lx] 
     */
    public function show($id)
    {
    	$list = $this->model->find($id);
        return $this->fetch('detail', ['ad' => $list]);
      }
    /**
     * [del删除]
     * @author [lx] 
     */
    public function delete()
    {
        $id = input('param.id');
        if ($this->model->destroy($id)) {
            $this->success('删除成功');
        } else {
            $this->error('删除失败');
        }
    }
   
}